package com.woniuxy.service.imlp;

import com.woniuxy.dao.MenuDao;
import com.woniuxy.entity.RbacMenu;
import com.woniuxy.service.MenuService;
import com.woniuxy.utils.Resout;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MenuServiceImpl implements MenuService {
    @Autowired(required = false)
    MenuDao menuDao;
    @Override
    public Resout getAll() {
        return new Resout("查询成功",200,menuDao.getAll());
    }

    @Override
    public Resout findSon(int fid) {
        return new Resout("查询成功",200,menuDao.findSon(fid));
    }

    @Override
    public Resout save(RbacMenu rbacMenu) {
        if(menuDao.save(rbacMenu)){
      return new Resout("添加成功",200,null);
    }else {
        return new Resout("修改失败",403,null);}
    }
}
